<?php
//项目目录
header("Content-Type:text/html;charset=utf-8");
function dirLists($path){
	$readFileArray = array();
    if ($handle = opendir($path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != ".." && $file != ".svn") {
                if (is_dir($path."/".$file)) {
                    $readFileArray[$file] = $file;
                }
            }
        }
    }
    return $readFileArray;
}
function readTxtLists($readFile){
	$readFilePathArray = dirLists(dirname(__FILE__));
	$rootPath = dirname(__FILE__);
	foreach($readFilePathArray as $key=>$value){
		$readFilePathArray[$key] = file_get_contents($rootPath.DIRECTORY_SEPARATOR.$value.DIRECTORY_SEPARATOR.$readFile)."<br>";
	}
	return $readFilePathArray;
}

$readTxtArray = readTxtLists("readDir.txt");

$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

foreach($readTxtArray as $key=>$value){
	echo "<a href='".$url.$key."' >".$key."</a>&nbsp&nbsp->&nbsp&nbsp".$value;	
}
?>